package com.service;

import com.dao.StatisticsDao;
import com.dto.BorrowBookDTO;
import com.vo.StatisticsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author linyukun
 * @date 2022/10/14 11:08
 */
@Service
public class StatisticsServiceImpl {
    @Autowired
    private StatisticsDao statisticsDao;

    public Map<String,Object> getStatistics(BorrowBookDTO dto) {
        Map<String,Object> result = new HashMap<>();
        List<StatisticsVO> borrowStatistics = statisticsDao.getStatistics(1);//借书情况
        List<StatisticsVO> backStatistics = statisticsDao.getStatistics(2);//还书情况
        List<StatisticsVO> registerStatistics = statisticsDao.getStatistics(3);//办证情况
        //statisticsDao.getStatistics(4);//活动情况
        result.put("borrowStatistics",borrowStatistics);
        result.put("backStatistics",backStatistics);
        result.put("registerStatistics",registerStatistics);
        return result;
    }
}
